Imports Sys = System

Namespace Enhancements.Core
    ''' <summary>The exception that is thrown when a string part is not in a bigger string.</summary>
    <DebuggerStepThrough()> _
    Public NotInheritable Class IsInNotException
        Inherits AssertException

        Friend Sub New(ByVal _objectName As System.String, ByVal _object As System.String, ByVal _objectCharacter As System.Char)
            MyBase.New(_objectName)
            [Object] = _object
            ObjectCharacter = _objectCharacter
        End Sub

        Friend Sub New(ByVal _objectName As System.String, ByVal _object As System.String, ByVal _objectArray() As System.String)
            MyBase.New(_objectName)
            [Object] = _object
            ObjectArray = _objectArray
        End Sub

        Private __Object As System.String = Nothing
        ''' <summary>Gets the string used as basis for searching.</summary>
        Public Property [Object]() As System.String
            Get
                Return __Object
            End Get
            Private Set(ByVal _value As System.String)
                __Object = _value
            End Set
        End Property

        Private __ObjectCharacter As System.Char = " "c
        ''' <summary>Gets the character searched. Only one of the ObjectCharacter and ObjectArray properties is used. If the value here is Space then the ObjectArray property might be in use.</summary>
        Public Property ObjectCharacter() As System.Char
            Get
                Return __ObjectCharacter
            End Get
            Private Set(ByVal _value As System.Char)
                __ObjectCharacter = _value
            End Set
        End Property

        Private __ObjectArray() As System.String = CType(Sys.Array.CreateInstance(GetType(System.String), 0), String())
        ''' <summary>Gets the string array searched. Only one of the ObjectCharacter and ObjectArray properties is used. If the value here is a 0-length array then the ObjectCharacter property might be in use.</summary>
        Public Property ObjectArray() As System.String()
            Get
                Return __ObjectArray
            End Get
            Private Set(ByVal _value() As System.String)
                __ObjectArray = _value
            End Set
        End Property

    End Class
End Namespace
